<template>
	<joy-page class="">
		<view class="uni-list">
			<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item, index) in st" :key="index"  @click="goShitiDetail(item.questionsid)">
				<view class="uni-media-list">
					<view class="uni-media-list-body">
						<view class="uni-media-list-text-top">
							<text style="">{{ item.questionsname }}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</joy-page>
</template>

<script>
	import uniGrid from "@/components/uni-grid/uni-grid.vue"
	import uniCard from "@/components/uni-card/uni-card.vue"
	import mPageView from "@/components/m-page-view/m-page-view.vue"
	import subjectiveCaseApi from "@/api/subjectiveCase.js"
	let _this;
	export default {
		components: {
			uniGrid,
			uniCard,
			"joy-page":mPageView
		},

		data() {
			return {
				query:{},
				page:1,
				pagenum:8,
				count:0,
				st:[]
			}
		},
		onLoad(query) {
			_this = this;
			_this.query = query
			// _this.getKa()
			_this.initData()
		},
		onReachBottom(e) {
			console.log(e)
			if(_this.count == _this.st.length){
				return
			}
			_this.initData()
		},
		methods: {
			initData(){
				let {id} = _this.query
				subjectiveCaseApi.l_que_list_by_tea_page({id,page:_this.page,pagenum:_this.pagenum}).then(res=>{
					console.log(res)
					_this.count = res.data.count
					res.data.list = res.data.list || []
					_this.st = _this.st.concat(res.data.list)
				})
			},
			goShitiDetail(id){
				console.log(id)
				uni.navigateTo({
					url:`/pages/subjectiveCase/detail?id=${id}`
				})
			},
			handleClickGrid(o) {
				console.log(o)
				let index = o.index
				let item = this.grid[index]
				console.log(item.path)
				uni.navigateTo({
					url:item.path
				})
			},
		 


		}
	}
</script>

<style lang="scss" scoped>
	
	@import url("../../common/uni/uni.css"); 
	body,
	page {
		min-height: 100%;
		display: flex;
		font-size: 32upx;
	}
	
	body.modal-open {
		position: fixed;
		width: 100%;
	}
	.ad-box {
		display: flex;
		justify-content: center;
		background: #fff;
		
		/* margin-top: 10upx; */
		.ad {
			image {
	
				width: 335upx;
				height: 185upx;
				margin: 15upx;
			}
		}
	}
	/* #ifdef MP-BAIDU */
	page {
		width: 100%;
		height: 100%;
		display: block;
	}

	
	
	swan-template {
		width: 100%;
		min-height: 100%;
		display: flex;
	}
	
	/* #endif */
	
	.content {
		display: flex;
		flex: 1;
		flex-direction: column;
		background-color: #efeff4;
		width: 100%;
	}
	
	.pad-10 {
		padding: 10upx;
	}
	
	.mt-10 {
		margin-top: 10upx;
	}
	
	.ellipsis{
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	
	.input-row {
		display: flex;
		flex-direction: row;
		position: relative;
		background: #fff;
	}
	
	.input-row .title {
		width: 25%;
		padding: 20upx 0;
		padding-left: 20upx;
		line-height: 50upx;
	}
	
	.border-1px {
		position: relative;
	
		&::before {
			position: absolute;
			z-index: 1;
			right: 0;
			top: 0;
			left: 0upx;
			height: 1upx;
			content: '';
			-webkit-transform: scaleY(.5);
			transform: scaleY(.5);
			background-color: #e2e2e2;
		}
	
		&::after {
			position: absolute;
			z-index: 1;
			right: 0;
			bottom: 0;
			left: 0upx;
			height: 1upx;
			content: '';
			-webkit-transform: scaleY(.5);
			transform: scaleY(.5);
			background-color: #e2e2e2;
		}
	}
	
	.border-bottom-1px {
		position: relative;
	
		&::after {
			position: absolute;
			z-index: 1;
			right: 0;
			bottom: 0;
			left: 20upx;
			height: 1upx;
			content: '';
			-webkit-transform: scaleY(.5);
			transform: scaleY(.5);
			background-color: #e2e2e2;
		}
	}
	
	.btn-row {
		margin-top: 50upx;
		padding: 20upx;
	}
	
	button.primary {
		background-color: #0faeff;
	}
	.ka {
		width: 100%;
		height: 260upx;
		position: relative;

		&:after {
			content: '';
			position: absolute;
			transform-origin: center;
			box-sizing: border-box;
			pointer-events: none;
			top: -50%;
			left: -50%;
			right: -50%;
			bottom: -50%;
			border-bottom: 1px solid $uni-border-color;
			transform: scale(.5);
		}
	}
	
	
	.uni-media-list{
		padding: 10px 10px;
	}
	.uni-media-list-logo {
		width: 220upx;
		height: 160upx;
	}
	
	.uni-media-list-body {
		height: auto;
		justify-content: space-around;
	}
	
	.uni-media-list-text-top {
		// height: 60upx;
		font-size: 28upx;
		
	}
	.uni-media-list-text-body {
		// height: 60upx;
		font-size: 28upx;
		
	}
	.uni-media-list-text-bottom {
		// height: 60upx;
		font-size: 28upx;
		
	}
	
	.uni-list::before,.uni-list:after{
		height: 0px;
	}
	
	
</style>
